<form action="{:url()}" class="layui-form layui-form-pane" method="post" style="margin: 20px">
    <table class="layui-table" lay-skin="line">
        <colgroup>
            <col width="150">
            <col>
        </colgroup>
        <tbody>
        {volist name="permission" id="vo"}
        <tr class="b-group">
            <td><input name="permissions[]" value="{$vo.permission_id}" onclick="checkAll(this)"  lay-ignore type="checkbox"
                       {in name="$vo.permission_id" value="$roleList"}
                       checked
                       {/in}> {$vo.permission_name}</td>
            <td>
                {volist name="vo._data" id="v"}
                <table class="layui-table" lay-skin="row">
                    <colgroup>
                        <col width="150">
                        <col>
                    </colgroup>
                    <tbody>
                    <tr>
                        <td><input name="permissions[]" value="{$v.permission_id}" onclick="checkAll(this)"  lay-ignore type="checkbox"
                                   {in name="$v.permission_id" value="$roleList"}
                                   checked
                                   {/in}> {$v.permission_name}</td>
                        <td>
                            {volist name="v._data" id="a"}
                            <input name="permissions[]" value="{$a.permission_id}" lay-ignore type="checkbox"
                                   {in name="$a.permission_id" value="$roleList"}
                                   checked
                                   {/in}
                            >{$a.permission_name}
                            {/volist}
                        </td>
                    </tr>
                    </tbody>
                </table>
                {/volist}
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="layui-form-item">
        <input type="hidden" name="id" value="{$role_id}">
        <button class="layui-btn" lay-submit="" lay-filter="ajax">确定</button>
    </div>
</form>
<script>
    function checkAll(obj) {
        console.log(111)
        $(obj).parents('.b-group').eq(0).find("input[type='checkbox']").prop('checked', $(obj).prop('checked'));
    }
</script>